<?php
/**
 * Created by PhpStorm.
 * User: 快定
 * Date: 2022/1/5
 * Time: 14:31
 */
$redis = new Redis();
$redis->connect('127.0.0.1', '6379');
$key = "listMq";
for($i=0;$i<100;$i++){
    $data = [
        'id' => rand(1,500),
        'price' => rand(5000,10000),
        'num'   => rand(1,10),
    ];
    $data = json_encode($data);
    $redis->lPush($key,$data);
}
